package com.tbit.uqbike.service.rpcservice;


import com.tbit.uqbike.object.business.User2Machine;
import com.tbit.uqbike.object.pojo.Account;
import com.tbit.uqbike.object.pojo.Machine;
import com.tbit.uqbike.object.value.LoginInfo;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author MyWin E-mail:335918956@qq.com
 * @version 1.0
 * @createTime 2019-12-06 14:34
 */
public interface PurviewService {
    /**
     * 权限检查
     *
     * @param operateType
     * @param operateId
     * @param objType
     * @param objId
     * @return
     */
    boolean purviewCheck(Integer operateType, Integer operateId, Integer objType, Integer objId);

    /**
     * 权限检查
     *
     * @param operateId
     * @param objId
     * @return
     */
    boolean purviewCheck(Integer operateId, Integer objId);

    boolean purviewCheck(Account opAcc, Account objAcc);

    /**
     * @param operateId
     * @param machine
     * @return
     */
    boolean purviewCheck(Integer operateId, Machine machine);

    /**
     * 检测是否有权限操作设备
     *
     * @param opAcc
     * @param machine
     * @return
     */
    boolean purviewCheck(Account opAcc, Machine machine);

    User2Machine getUser2Machine(LoginInfo info);

    /**
     * 过滤代理商id
     *
     * @param opAcc
     * @param accountIds
     * @return
     */
    List<Integer> filterAgent(Account opAcc, List<Integer> accountIds);

    /**
     * 获取代理商列表
     *
     * @param account
     * @return
     */
    List<Integer> getAgentList(Account account);

    /**
     * 过滤加盟商
     *
     * @param opAcc
     * @param accountIds
     * @return
     */
    List<Integer> filterFranchisee(Account opAcc, List<Integer> accountIds);


    Map<Integer, Boolean> purviewCheckV2(Integer loginUserId, Set<Integer> machineAIds);

    /**
     * 权限检查
     *
     * @param operateId 操作区域id
     * @param objId     目标区域id集合
     */
    boolean purviewCheck(Integer operateId, List<Integer> objId);
}
